home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 13 - 1997 (partial) / 13.05 May 97 / WebObjects Overview / Main.java < prev   
Encoding:
Text File  |  1997-03-26  |  534 b   |  22 lines  |  [TEXT/R*ch]

  1. // A custom subclass of the WebObjects Java class “Component” 
  2. // (WOComponent in the Java name space). The NeXT Java frameworks are 
  3. // imported as next.util.* and next.wo.*.  This subclass declares a Java 
  4. // String as an instance variable and a single action method.
  5.  
  6. import next.util.*;
  7. import next.wo.*;
  8.  
  9. public class Main extends Component
  10. {
  11.     String visitorName;
  12.  
  13.     public Component sayHello()
  14.     {
  15.         Hello nextPage = 
  16.  
  17.             (Hello)application().pageWithName("Hello");
  18.         nextPage.setVisitorName(visitorName);
  19.         return nextPage;
  20.     }
  21. }
  22.